<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Amaze UI Admin index Examples</title>
    <meta name="description" content="这是一个 index 页面">
    <meta name="keywords" content="index">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="icon" type="image/png" href="__STATIC__/assets/i/favicon.png">
    <link rel="apple-touch-icon-precomposed" href="__STATIC__/assets/i/app-icon72x72@2x.png">
    <meta name="apple-mobile-web-app-title" content="Amaze UI" />
    <link rel="stylesheet" href="__STATIC__/assets/css/amazeui.min.css" />
    <link rel="stylesheet" href="__STATIC__/assets/css/admin.css">
    <link rel="stylesheet" href="__STATIC__/assets/css/app.css">
</head>

<body data-type="generalComponents">
    {include file="public:header"/}

    {include file="public:sidemenu"/}

    

        <div class="tpl-content-wrapper">
            <div class="tpl-content-page-title">
                修改用户
            </div>
            <ol class="am-breadcrumb">
                <li><a href="#" class="am-icon-home">列表</a></li>
                <li><a href="#">表单</a></li>
                <li class="am-active">修改用户</li>
            </ol>
            <div class="tpl-portlet-components">
                <div class="portlet-title">
                    <div class="caption font-green bold">
                        <span class="am-icon-code"></span> 表单
                    </div>
                    
                </div>

                <div class="tpl-block">

                    <div class="am-g">
                        <div class="tpl-form-body tpl-form-line">
                            <form class="am-form tpl-form-line-form" method="post" enctype="multipart/form-data" action="{:url('formuser/updateUser',['id'=>$result.u_id])}">
                                <input type="hidden" name="u_id" value="{$result.u_id}">
                                <div class="am-form-group">
                                    <label for="user-name" class="am-u-sm-3 am-form-label">姓名</label>
                                    <div style="height: 25%"></div>
                                    <div class="am-u-sm-9">
                                        <input type="text" class="tpl-form-input" id="user-name" name="u_name" 
                                        value="{$result.u_name}" placeholder="请输入姓名">
                                    </div>
                                </div>
                                <div class="am-form-group">
                                    <label for="user-name" class="am-u-sm-3 am-form-label">密码</label>
                                    <div style="height: 25%"></div>
                                    <div class="am-u-sm-9">
                                        <input type="text" class="tpl-form-input" id="user-name" name="u_password" value="" placeholder="请输入密码">
                                    </div>
                                </div>
                                
                                <div class="am-form-group">
                                    <label for="user-name" class="am-u-sm-3 am-form-label">身份证号</label>
                                    <div style="height: 25%"></div>
                                    <div class="am-u-sm-9">
                                        <input type="text" class="tpl-form-input" id="user-name" name="u_num" value="{$result.u_num}" placeholder="请输入身份证号">
                                    </div>
                                </div>
                                <div class="am-form-group">
                                    <label for="user-name" class="am-u-sm-3 am-form-label">联系方式</label>
                                    <div style="height: 25%"></div>
                                    <div class="am-u-sm-9">
                                        <input type="text" class="tpl-form-input" id="user-name" name="u_telephone" value="{$result.u_telephone}" placeholder="请输入联系方式">
                                    </div>
                                </div>
                                <div class="am-form-group">
                                    <label for="user-name" class="am-u-sm-3 am-form-label">性别 </label>
                                    <div style="height: 25%"></div>
                                    <div class="am-u-sm-9">
                                        <label class="radio-inline">
                                        {if condition="$result.u_gender==0"}
                                        <input type="radio" name="gender" id="inlineRadio2" value="0" checked="checked">
                                        {else /}
                                        <input type="radio" name="gender" id="inlineRadio2" value="0">
                                        {/if}
                                        男
                                        </label>
                                        <label class="radio-inline">
                                        {if condition="$result.u_gender==1"}
                                        <input type="radio" name="gender" id="inlineRadio1" value="1" checked="checked">
                                        {else /}
                                        <input type="radio" name="gender" id="inlineRadio1" value="1">
                                        {/if}
                                        女
                                        </label>                                       
                                    </div>
                                </div>
                                <div class="am-form-group">
                                    <label for="user-weibo" class="am-u-sm-3 am-form-label">头像</label>
                                    <div class="am-u-sm-9">
                                        <div class="am-form-group am-form-file">
                                            <div class="tpl-form-file-img">
                                                <img src="__STATIC__/posters/{$result.u_pic}" alt="" id="photo">
                                            </div>
                                            <button type="button" class="am-btn am-btn-danger am-btn-sm">
    <i class="am-icon-cloud-upload"></i> 添加封面图片</button>
                                            <input type="hidden" name="pic2" id="pic_edit2" value="{$result.u_pic}">
                                            <input id="doc-form-file" onchange="preImg(this.id,'photo');" type="file" name="pic" multiple >
                                        </div>

                                    </div>
                                </div>

                                

                                <div class="am-form-group">
                                    <div class="am-u-sm-9 am-u-sm-push-3">
                                        <button type="submit" class="am-btn am-btn-primary tpl-btn-bg-color-success ">提交</button>
                                    </div>
                                </div>
                               
                            </form>

                        </div>
                    </div>
                </div>


            </div>

        </div>

    </div>


    {include file="public:footer"}
</body>
<script type="text/javascript">  
            function getFileUrl(sourceId) {  
                var url;  
                if (navigator.userAgent.indexOf("MSIE")>=1) { // IE  
                    url = document.getElementById(sourceId).value;  
                } else if(navigator.userAgent.indexOf("Firefox")>0) { // Firefox  
                    url = window.URL.createObjectURL(document.getElementById(sourceId).files.item(0));  
                } else if(navigator.userAgent.indexOf("Chrome")>0) { // Chrome  
                    url = window.URL.createObjectURL(document.getElementById(sourceId).files.item(0));  
                }  
                return url;  
            }  
            function preImg(sourceId, targetId) {   
                var url = getFileUrl(sourceId);   
                var imgPre = document.getElementById(targetId);   
                imgPre.src = url;   
            }   
    </script>  
</html>